import request from '@/config/axios'

export interface ScholarshipVO {
  id: number
  major: number
  studentNumber: number
  studentName: string
  scholarshipCategory: string
  scholarshipName: string
  level: string
  awardingAuthority: string
  awardDate: undefined
  remark: string
  status: number
  reason: string
}

// 查询奖学金信息列表
export const getScholarshipPage = async (params) => {
  return await request.get({ url: `/data/scholarship/page`, params })
}

// 查询奖学金信息详情
export const getScholarship = async (id: number) => {
  return await request.get({ url: `/data/scholarship/get?id=` + id })
}

// 新增奖学金信息
export const createScholarship = async (data: ScholarshipVO) => {
  return await request.post({ url: `/data/scholarship/create`, data })
}

// 修改奖学金信息
export const updateScholarship = async (data: ScholarshipVO) => {
  return await request.put({ url: `/data/scholarship/update`, data })
}

// 修改奖学金信息
export const updateScholarshipStatus = async (data: ScholarshipVO) => {
  return await request.put({ url: `/data/scholarship/updateStatus`, data })
}

// 删除奖学金信息
export const deleteScholarship = async (id: number) => {
  return await request.delete({ url: `/data/scholarship/delete?id=` + id })
}

// 导出奖学金信息 Excel
export const exportScholarship = async (params) => {
  return await request.download({ url: `/data/scholarship/export-excel`, params })
}
